package com.lyz.dataStructure.algorithm.zoom2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 14:35
 * @Description:
 **/


import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/17 14:35
 *@Description:
 **/
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String str = sc.nextLine();
        int n = sc.nextInt();
        String str1 =removeKo(str,n);
        StringBuffer stringBuffer = new StringBuffer();
        for(int i =0;i<str1.length();i++){
            if(str1.charAt(i)=='\u0000'){
                continue;
            }else {
               stringBuffer.append(str1.charAt(i));

            }
        }
        System.out.println(stringBuffer.toString());

    }

    public static  String removeKo(String str,int k){
        if(str==null ||k<1){
            return  str;
        }
        char[] cha = str.toCharArray();
        int count = 0;
        int start = -1;
        for(int i=0;i<cha.length;i++){
            if(cha[i] =='0'){
                count++;
                start = start==-1?i:start;
            }else {
                if(count==k){
                    while (count-- !=0){
                        cha[start++] = 0;
                    }
                }
                start =-1;
                count = 0;
            }
        }
        if(count ==k){
            while (count-- !=0){
                cha[start++] = 0;
            }
        }

        return  String.valueOf(cha);
    }
}
